<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="js/highcharts.js"></script>
    <script type="text/javascript" src="themes/theme.js"></script>
    <script type="text/javascript" src="js/exporting.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="js/highchartsModel.js"></script>
    <script type="text/javascript" src="js/highchartsBase.js"></script>
    <script>
        var idle= [];
        var iowait = [];
        var categories = [];
        var temp;
        $(function () {
            $.get( "txt/sar_cpu.txt", function( data ) {
                var resourceContent = data.toString(); // can be a global variable too...
                var rc = resourceContent.split("\n");
                for(var i=0; i<rc.length; i++){
                 temp = getNotNullArr(rc[i].split(" "));
                    console.log(temp);
                    idle.push(parseFloat(temp[temp.length-1]));
                    categories.push(temp[0]);
                    iowait.push(parseFloat(temp[6]));
                }
                set_h_title("cpu使用情况");
                set_h_sub_title("test.com");
                set_h_xaxis_setp(1);
                set_h_tooltip("%");
                set_h_yaxis_title("cpu使用情况");
                set_h_xaxis_categories(categories);
                set_h_series( [{name: 'idle',data:idle}, {name: 'iowait', data: iowait}]);
                highchartsinit("#container",get_h_title(),get_h_sub_title(),get_h_xaxis_setp(),get_h_xaxis_categories(),get_h_yaxis_title(),get_h_tooltip(),get_h_series());
        });
        });
    </script>
</head>
<body>
<div id="container" style="min-width:700px;height:400px"></div>
<div>
    <a href="index.htm">CPU使用情况</a>
    <a href="sar_men.html">内存使用情况</a>
    <a href="sar_io.html">硬盘IO使用情况</a>
</div>
</body>
</html>